<?php
	$reply_id = $params[1];
	if($_SERVER["REQUEST_METHOD"]=='POST') {
		$detail			= $_POST['detail'];
		$status			= $_POST['status']=='publish' ? '1': '0';
		$ip				= getUserIP();

		$sql = "UPDATE `tbl_webboard_reply` SET `title` = '$title', `detail` = '$detail' , `ip` = '$ip', `status` = '$status' WHERE  `reply_id` = '$reply_id' LIMIT 1;";
		mysql_query($sql);
		redirect('../');
		exit;
	}

	$sql = "SELECT * FROM `tbl_webboard_reply` WHERE `reply_id` = '$reply_id' LIMIT 1";
	$query = mysql_query($sql);
	while($result = mysql_fetch_assoc($query)) {
		$detail			= $result['detail'];
	}
	mysql_free_result($query);
 
 
	include 'ckeditor/ckeditor.php';
	include 'ckeditor/ckfinder/ckfinder.php';
	
	$ckeditor = new CKEditor();
	$ckeditor->returnOutput			= true;
	$ckeditor->basePath				= '/backend/ckeditor/'; 

	CKFinder::SetupCKEditor($ckeditor, '/backend/ckeditor/ckfinder/');
	$detailHTML = $ckeditor->editor('detail', $detail);
?>